<?php

/**
 * tis-tis 首页文件
 *
 * @copyright (c)2010 昆明力行软件  保留所有权利。
 * @link http://www.tis-tis.com
 * @Author: qilei
 * @version: 1.0.0
 */

require_once '../init.php';
require_once TIS_ROOT.'/internal/common.php';
require_once TIS_ROOT.'/admin/internal/smarty_config.php';


$smarty->assign('title','淘宝独立网店 TIS后台管理');
$smarty->assign('hello','Hello world! 淘宝独立网店TIS 从此诞生了！');
$smarty->assign('tpl_path','templates/default');

if(isLogin() === false)
{
	redirectURL('login.php', "请登陆后台！");
}

else{
	if ($action == '') {
		$avatar = empty($user_cache[UID]['avatar']) ? './views/' . ADMIN_TPL . '/images/avatar.jpg' : '../' . $user_cache[UID]['avatar'];
		$name =  $user_cache[UID]['name'];

		$sta_log = ROLE == 'admin' ? $sta_cache['lognum'] : $sta_cache[UID]['lognum'];
		$sta_tw = ROLE == 'admin' ? $sta_cache['twnum'] : $sta_cache[UID]['twnum'];

		$serverapp = $_SERVER['SERVER_SOFTWARE'];
		$mysql_ver = $DB->getMysqlVersion();
		$php_ver = PHP_VERSION;
		$uploadfile_maxsize = ini_get('upload_max_filesize');
		$safe_mode = ini_get('safe_mode');

		if (function_exists("imagecreate"))
		{
			if(function_exists('gd_info'))
			{
				$ver_info = gd_info();
				$gd_ver = $ver_info['GD Version'];
			}else{
				$gd_ver = '支持';
			}
		}else{
			$gd_ver = '不支持';
		}


		$smarty->display('index.tpl');

	}
	//phpinfo()
	if ($action == 'phpinfo') {
		@phpinfo() OR formMsg("phpinfo函数被禁用!", "javascript:history.go(-1);", 0);
	}
}
?>
